<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 请输入路程
        let num=+prompt('请输入路程')
        //计算车费
        if(num<=3 && num>=0){
            alert('请缴纳10元车费')
        }else if(num<=15&&num>3){
            num=10+(num-3)*2
            alert(`请缴纳${num}元车费`)
        }else if(num>15&&num<=300){
            num=10+(num-3)*2+(num-15)*2*1.5
            alert(`请缴纳${num}元车费`)
        }else if(num<0||num>300){
            alert('输入错误，请重新输入')
        }
    </script>
</body>
</html>